import com.sun.media.jfxmediaimpl.HostUtils;

import java.util.Scanner;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-16
 */
class Out{
    public int a1 = 1;
    public static int a2 = 2;
    class Inner{
        public int a1 = 999;
        public int a3 = 3;
        public static final int a4 = 4;
        public void func(){
            System.out.println(Out.this.a1);
        }
    }
    static class Inner2 {
        public int a1 = 666;
        public int a3 = 33;
        public static int a4 = 44;

        static {
            System.out.println(a4);
        }

        public void func() {
            Out tmp = new Out();
            System.out.println(tmp.a1);
            System.out.println(a3);

        }
    }

    @Override
    public String toString(){
        return "a1=" + a1 + "  " + "a2=" + a2;
    }
}


public class Main {

    public static void main(String[] args) {
        Out a = new Out();
        Out.Inner aa = a.new Inner();
        Out.Inner bb = new Out().new Inner();
        Out.Inner2 aa1 = new Out.Inner2();

        System.out.println(Out.a2);
        System.out.println(Out.Inner.a4);
        aa.func();
        aa1.func();
        System.out.println(aa);
    }
}
